package com.project.plus.controller;

import com.project.plus.util.CodeUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName LoginController
 * @Description TODO
 * @Author Invoker
 * @Date 2020/9/27 17:06
 * @Version 1.0
 */
@Controller
public class LoginController {
    
    @RequestMapping("/codeTest")
    @ResponseBody
    public String codeTest(HttpServletRequest request){
        if (!CodeUtil.checkVerifyCode(request)) {
            return "验证码出错";
        }else{
            return "hello,world";
        }
    }

    @RequestMapping("/hello")
    public String hello(HttpServletRequest request){
        return "hello.html";
    }
}
